//用户管理

var express = require('express');
var router = express.Router();
var sqlQuery = require('../../../module/sql');
var jiami = require('../../../module/jiami');



//删除用户
router.get('/',async(req,res)=>{
    let userid = req.query.userid
    let sqlStr = "delete from user where id = ?";
    let result = await sqlQuery(sqlStr,[userid])
    res.json({
      state:"ok",
      content:Array.from(result)
    })
  })


// //用户状态更改
// router.get('/state',async(req,res)=>{
//   let userid = req.query.userid
//   let state = req.query.state
//   if(state == 1){
//     state = 0
//   }else{
//     state = 1
//   }
//   let sqlStr = "update user set state = ? where id = ?";
//   let result = await sqlQuery(sqlStr,[userid,state])
//   res.json({
//     state:"ok",
//     content:Array.from(result)
//   })
// })



module.exports = router;